package homeWork;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.SimpleTimeZone;

public class test2 {
    public static void main(String[] args) throws ParseException {
        LocalDateTime of = LocalDateTime.of(2021, 10, 8, 19, 42, 53);
        LocalDateTime of1 = LocalDateTime.of(1999, 10, 22, 0, 0, 0);
        Duration between = Duration.between(of1, of);
        System.out.println(between.toMillis() / 1000 / 60 / 60 / 24);

        String s = "1999-10-22 10-22-22";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
        Date parse = simpleDateFormat.parse(s);
        Date date = new Date();
        long time = date.getTime() - parse.getTime();
        long a = time / 1000 / 60 / 60 / 24;
        System.out.println(a);

    }
}
